package com.kaishengit.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.kaishengit.entity.Account;
import com.kaishengit.entity.Log;
import com.kaishengit.service.LogService;

public class LogServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		HttpSession session = request.getSession();
		Account account = (Account)session.getAttribute("session_account");
		
		LogService service = new LogService();
		List<Log> loglist = service.findByAid(account.getId());
		
		request.setAttribute("loglist", loglist);
		request.getRequestDispatcher("/WEB-INF/views/note.jsp").forward(request, response);
	}

}
